using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Floating : MonoBehaviour
{
    public float rotateSpeed = 1.0f;
    public float amplitude = 1.0f;
    private float originY;
    private void Start()
    {
        originY = transform.position.y;
    }

    private void Update()
    {
        transform.position = new Vector3(transform.position.x, originY + amplitude * Mathf.Sin(Time.realtimeSinceStartup), transform.position.z);
        transform.rotation *= Quaternion.Euler(0, Time.deltaTime * rotateSpeed, 0);
    }
}
